package conf

import (
	"encoding/json"
	"io/ioutil"
	"os"
)

var config map[string]string

func LoadConfig() {
	f, err := os.Open("conf/config.json")
	if err != nil {
		panic(err)
	}

	fBytes, err := ioutil.ReadAll(f)
	if err != nil {
		panic(err)
	}

	if err := json.Unmarshal(fBytes, &config); err != nil {
		panic(err)
	}
}

func GetConfig(key string) string {
	return config[key]
}
